package com.giaothong.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.giaothong.config.Define;
import com.giaothong.db.table.DtbLikeLocation;

public class DatabaseManager extends SQLiteOpenHelper {
	private Context context;

	public DatabaseManager(Context context) {
		super(context, Define.DATABASE_NAME, null, Define.DATABASE_VERSION);
		this.context = context;
	}

	// =============================================================================
	// @Override functions
	// =============================================================================

	/**
	 * create Table in here
	 * 
	 */
	@Override
	public void onCreate(SQLiteDatabase db) {
		DtbLikeLocation.createTable(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		DtbLikeLocation.dropTable(db);
		onCreate(db);
	}

}
